import 'package:json_annotation/json_annotation.dart'; 
  
part 'community_model.g.dart';

// 获取社区文章
@JsonSerializable()
  class CommunityModel extends Object {

  @JsonKey(name: 'code')
  int code;

  @JsonKey(name: 'message')
  String message;

  @JsonKey(name: 'data')
  List<Data> data;

  CommunityModel(this.code,this.message,this.data,);

  factory CommunityModel.fromJson(Map<String, dynamic> srcJson) => _$CommunityModelFromJson(srcJson);

  Map<String, dynamic> toJson() => _$CommunityModelToJson(this);

}

  
@JsonSerializable()
  class Data extends Object {

  @JsonKey(name: 'id')
  int id;

  @JsonKey(name: 'is_following')
  int isFollowing;

  @JsonKey(name: 'content')
  String content;

  @JsonKey(name: 'agree')
  int agree;

  @JsonKey(name: 'is_agree')
  int isAgree;

  @JsonKey(name: 'collections')
  int collections;

  @JsonKey(name: 'read')
  int read;

  @JsonKey(name: 'dynamic_time')
  int dynamicTime;

  @JsonKey(name: 'user_info')
  User_info userInfo;

  @JsonKey(name: 'pictures')
  List<Pictures> pictures;

  Data(this.id,this.isFollowing,this.content,this.agree,this.isAgree,this.collections,this.read,this.dynamicTime,this.userInfo,this.pictures,);

  factory Data.fromJson(Map<String, dynamic> srcJson) => _$DataFromJson(srcJson);

  Map<String, dynamic> toJson() => _$DataToJson(this);

}

  
@JsonSerializable()
  class User_info extends Object {

  @JsonKey(name: 'user_id')
  int userId;

  @JsonKey(name: 'nick_name')
  String nickName;

  @JsonKey(name: 'sex')
  int sex;

  @JsonKey(name: 'head_img')
  String headImg;

  User_info(this.userId,this.nickName,this.sex,this.headImg,);

  factory User_info.fromJson(Map<String, dynamic> srcJson) => _$User_infoFromJson(srcJson);

  Map<String, dynamic> toJson() => _$User_infoToJson(this);

}

  
@JsonSerializable()
  class Pictures extends Object {

  @JsonKey(name: 'name')
  String name;

  @JsonKey(name: 'origin')
  String origin;

  @JsonKey(name: 'thumbnail')
  String thumbnail;

  Pictures(this.name,this.origin,this.thumbnail,);

  factory Pictures.fromJson(Map<String, dynamic> srcJson) => _$PicturesFromJson(srcJson);

  Map<String, dynamic> toJson() => _$PicturesToJson(this);

}

  
